//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#include <ddk.h>

//
// Device Drivers
//

// pppdrv
#define DEVICENAME_PPPDRV               L"pppdrv"
EXTERN IDeviceDriver * CDECL CreatePppdrv(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_REGEVENTMAN      L"RegEventMan"
EXTERN IDeviceDriver * CDECL RegisterEventManager(uint_t uDeviceNo, void *pvParameter);

// Drvbuf
#define DEVICENAME_DRVBUF           L"drvbuf"

EXTERN IDeviceDriver * CDECL CreateDrvBuf(uint_t uDeviceNo, void *pvParameter);

// KTFS
#define DEVICENAME_KTFS             L"ktfsdriver"

EXTERN IDeviceDriver * CDECL CreateKtfs(uint_t uDeviceNo, void *pvParameter);

// Flash
#define DEVICENAME_FLASH            L"flash"

EXTERN IDeviceDriver * CDECL CreateFlash(uint_t uDeviceNo, void *pvParameter);

// Block Flash
#define DEVICENAME_FLASHSTORAGE     L"flashstorage"

EXTERN IDeviceDriver * CDECL CreateBlkFlash(uint_t uDeviceNo, void *pvParameter);

//Block Doc Storage 0
#define DEVICENAME_DOCSTORAGE     L"docstorage"
EXTERN IDeviceDriver * CDECL CreateDocStorage(uint_t uDeviceNo, void *pvParameter);

// Console
#define DEVICENAME_CONSOLE          L"console"

EXTERN IDeviceDriver * CDECL CreateConsole(uint_t uDeviceNo, void *pvParameter);

// Boot file list driver
#define DEVICENAME_BOOTMODS         L"bootmods"

EXTERN IDeviceDriver * CDECL CreateBootModules(uint_t uDeviceNo, void *pv);

//slip protocal
#define DEVICENAME_SLIP             L"slip"

EXTERN IDeviceDriver * CDECL CreateSLIP(uint_t uDeviceNo, void *pvParameter);

//GPIO
#define DEVICENAME_GPIO             L"gpio"

EXTERN IDeviceDriver * CDECL CreateGPIO(uint_t uDeviceNo, void *pvParameter);

//LCD Display
#define DEVICENAME_DISPLAY          L"display"

EXTERN IDeviceDriver * CDECL CreateDisplay(uint_t uDeviceNo, void *pvParameter);

#if (_TEST_TYPE == 5)    /* Test for interrupt latency performance */ \
    || (_TEST_TYPE == 6) /* Test for interrupt dispatch latency performance */
#define DEVICENAME_TSTTIMER            L"tsttimer"
EXTERN IDeviceDriver * CDECL CreateTimer(uint_t uDeviceNo, void *pvParameter);
#endif // _TEST_TYPE == 5 || _TEST_TYPE == 6

#define DEVICENAME_MTIMER            L"timer"

EXTERN IDeviceDriver * CDECL CreateMultiTimer(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_TOUCH            L"touch"

EXTERN IDeviceDriver * CDECL CreateTouch(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_USBFUNC          L"usbfunc"

EXTERN IDeviceDriver * CDECL CreateUsbFunc(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_USBSER           L"usbser"

EXTERN IDeviceDriver * CDECL CreateUsbSer(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_USBMASS          L"usbmass"

EXTERN IDeviceDriver * CDECL CreateUsbMass(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_XYMDM            L"xymdm"

EXTERN IDeviceDriver * CDECL CreateXYmdm(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_KEYPAD           L"keypad"

EXTERN IDeviceDriver * CDECL CreateKeypad(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_DMA              L"dma"

EXTERN IDeviceDriver * CDECL CreateDMA(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_AUDIO            L"wave"

EXTERN IDeviceDriver * CDECL CreateAudio(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_CAMERA           L"camera"

EXTERN IDeviceDriver * CDECL CreateCamera(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_MINISDBUS        L"minisdbus"

EXTERN IDeviceDriver * CDECL CreateMiniSDBus(uint_t uDeviceNo, void *pvParameter);

// statserver
#define DEVICENAME_STATDDRIVER      L"mstatserver"
EXTERN IDeviceDriver * CDECL CreateMStatServer(uint_t uDeviceNo, void *pvParameter);

#if (_TEST_TYPE == 2) /* Test for Daily Build */
// server for Daily Build
#define DEVICENAME_TESTINGDRIVER    L"testingserver"
EXTERN IDeviceDriver * CDECL CreateTestingServer(uint_t uDeviceNo, void *pvParameter);

// server Test for marshaling
#define DEVICENAME_MARSHALTEST          L"marshaltest1"
EXTERN IDeviceDriver * CDECL CreateMarshalTest(uint_t uDeviceNo, void *pvParameter);
#endif //_TEST_TYPE == 2

// serial
#define DEVICENAME_SERIAL           L"serial"
EXTERN IDeviceDriver * CDECL CreateSerial(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_NC               L"nc"
EXTERN IDeviceDriver * CDECL CreateNotiCenter(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_EQ               L"eq"
EXTERN IDeviceDriver * CDECL CreateEventQueues(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_POWER            L"power"
EXTERN IDeviceDriver * CDECL CreatePower(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_POWER_MANAGER            L"powermanager"
EXTERN IDeviceDriver * CDECL CreatePowerManagers(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_BATTERY          L"battery"
EXTERN IDeviceDriver * CDECL CreateBattery(uint_t uDeviceNo, void *pvParameter);


//
// Device Configurations
//
// NOTE: the device name can't be more than 31 words
STATIC DECL_DATAINIT DeviceConfig s_deviceConfigs[] = {
    { DEVICENAME_REGEVENTMAN,       DEVICENO_NONE, NULL },
    { DEVICENAME_DRVBUF,            DEVICENO_NONE, NULL },
    { DEVICENAME_CONSOLE,           0, NULL },
    { DEVICENAME_BOOTMODS,          0, NULL },
    { DEVICENAME_SLIP,              DEVICENO_NONE, NULL },
    { DEVICENAME_NC,                0, NULL },
    { DEVICENAME_EQ,                0, NULL },
    { DEVICENAME_MTIMER,             1, NULL },
    { DEVICENAME_GPIO,              DEVICENO_NONE, NULL },
    { DEVICENAME_DISPLAY,           0, NULL },
#if (_TEST_TYPE == 5)    /* Test for interrupt latency performance */ \
    || (_TEST_TYPE == 6) /* Test for interrupt dispatch latency performance */
    { DEVICENAME_TSTTIMER,          2, NULL },
#endif // _TEST_TYPE == 5 || _TEST_TYPE == 6
    { DEVICENAME_DMA,               DEVICENO_NONE,NULL },
    { DEVICENAME_AUDIO,             0, NULL },
    { DEVICENAME_CAMERA,            0, NULL },
    { DEVICENAME_USBFUNC,           DEVICENO_NONE, NULL },
    { DEVICENAME_USBSER,            DEVICENO_NONE, NULL },
    { DEVICENAME_USBMASS,           DEVICENO_NONE, NULL },
    { DEVICENAME_XYMDM,             DEVICENO_NONE, NULL },
    //{ DEVICENAME_MINISDBUS,         DEVICENO_NONE, NULL },
    { DEVICENAME_TOUCH,             DEVICENO_NONE, NULL },
    { DEVICENAME_KEYPAD,            0, NULL },
    { DEVICENAME_STATDDRIVER,       DEVICENO_NONE, NULL },
#if (_TEST_TYPE == 2) /* Test for Daily Build */
    { DEVICENAME_TESTINGDRIVER,     DEVICENO_NONE, NULL },
    { DEVICENAME_MARSHALTEST,       DEVICENO_NONE, NULL },
#endif //_TEST_TYPE == 2
    //{ DEVICENAME_FLASH,             DEVICENO_NONE, NULL },
    //{ DEVICENAME_FLASHSTORAGE,      DEVICENO_NONE, NULL },
    { DEVICENAME_DOCSTORAGE,        0, NULL },
    { DEVICENAME_DOCSTORAGE,        1, NULL },
    { DEVICENAME_KTFS,              DEVICENO_NONE, NULL },
    { DEVICENAME_SERIAL,              1, NULL },
    //{ DEVICENAME_SERIAL,            2, NULL },
    //{ DEVICENAME_SERIAL,            3, NULL },

    { DEVICENAME_POWER,             DEVICENO_NONE,NULL},
    { DEVICENAME_POWER_MANAGER,     DEVICENO_NONE,NULL},
    //{ DEVICENAME_BATTERY,           0, NULL},
    { DEVICENAME_PPPDRV,            DEVICENO_NONE, NULL },
};

//
// Driver Configurations
//
STATIC DriverConfig s_driverConfigs[] = {
    { DEVICENAME_REGEVENTMAN,       &RegisterEventManager},
    { DEVICENAME_DRVBUF,            &CreateDrvBuf },
    { DEVICENAME_CONSOLE,           &CreateConsole },
    { DEVICENAME_BOOTMODS,          &CreateBootModules },
    { DEVICENAME_SLIP,              &CreateSLIP },
    { DEVICENAME_NC,                &CreateNotiCenter},
    { DEVICENAME_EQ,                &CreateEventQueues},
    { DEVICENAME_MTIMER,            &CreateMultiTimer},
    { DEVICENAME_GPIO,              &CreateGPIO },
    { DEVICENAME_DISPLAY,           &CreateDisplay },
#if (_TEST_TYPE == 5)    /* Test for interrupt latency performance */ \
    || (_TEST_TYPE == 6) /* Test for interrupt dispatch latency performance */
    { DEVICENAME_TSTTIMER,          &CreateTimer},
#endif // _TEST_TYPE == 5 || _TEST_TYPE == 6
    { DEVICENAME_DMA,               &CreateDMA },
    { DEVICENAME_AUDIO,             &CreateAudio },
    { DEVICENAME_CAMERA,            &CreateCamera },
    { DEVICENAME_USBFUNC,           &CreateUsbFunc },
    { DEVICENAME_USBSER,            &CreateUsbSer },
    { DEVICENAME_USBMASS,           &CreateUsbMass },
    { DEVICENAME_XYMDM,             &CreateXYmdm },
    //{ DEVICENAME_MINISDBUS,         &CreateMiniSDBus },
    { DEVICENAME_TOUCH,             &CreateTouch },
    { DEVICENAME_KEYPAD,            &CreateKeypad },
    { DEVICENAME_STATDDRIVER,       &CreateMStatServer },
#if (_TEST_TYPE == 2) /* Test for Daily Build */
    { DEVICENAME_TESTINGDRIVER,     &CreateTestingServer },
    { DEVICENAME_MARSHALTEST,       &CreateMarshalTest },
#endif //_TEST_TYPE == 2
    //{ DEVICENAME_FLASH,             &CreateFlash },
    //{ DEVICENAME_FLASHSTORAGE,      &CreateBlkFlash },
    { DEVICENAME_DOCSTORAGE,        &CreateDocStorage },
    { DEVICENAME_KTFS,              &CreateKtfs },
    { DEVICENAME_SERIAL,            &CreateSerial },

    { DEVICENAME_POWER,              &CreatePower },
    { DEVICENAME_POWER_MANAGER,      &CreatePowerManagers},
    //{ DEVICENAME_BATTERY,            &CreateBattery },
    { DEVICENAME_PPPDRV,            &CreatePppdrv },
};

DzConfig dzcfg = {
	s_deviceConfigs,                // *pDeviceConfigs
	lengthof(s_deviceConfigs),      // uNumberOfDeviceConfigs

	s_driverConfigs,                // *pDriverConfigs
	lengthof(s_driverConfigs)       // uNumberOfDriverConfigs
};
